package com.bsoft.gol.hcs.specialist.dao;



import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import ctd.spring.boot.annotation.SsdevDao;
import ctd.util.annotation.RpcService;
import hcn.specialist.DocTeamSurveyQuestionnaireEntity;

import java.util.List;

@SsdevDao( serviceId = "docTeamSurveyQuestionnaireDAOService")
public abstract class DocTeamSurveyQuestionnaireDAO extends HibernateSupportDelegateDAO<DocTeamSurveyQuestionnaireEntity> {

    @RpcService
    @DAOMethod(sql = " from DocTeamSurveyQuestionnaireEntity where medical_team_id =:medicalTeamId ")
    public abstract List<DocTeamSurveyQuestionnaireEntity> queryDocTeamSurveyQuestionnaireList(@DAOParam("medicalTeamId")Long medicalTeamId);

    @RpcService
    @DAOMethod(sql = " from DocTeamSurveyQuestionnaireEntity where medical_team_id =:medicalTeamId and survey_questionnaire_id =:surveyQuestionnaireId")
    public abstract DocTeamSurveyQuestionnaireEntity getDocTeamSurveyQuestionnaire(@DAOParam("medicalTeamId")Long medicalTeamId, @DAOParam("surveyQuestionnaireId")Long surveyQuestionnaireId);

    @RpcService
    @DAOMethod(sql = "DELETE from DocTeamSurveyQuestionnaireEntity where medical_team_id =:teamId ")
    public abstract void deleteSurveyQuestionnaireByTeamId(@DAOParam("teamId")Long teamId);

    @RpcService
    public DocTeamSurveyQuestionnaireEntity saveDocTeamSurveyQuestionnaireEntity(DocTeamSurveyQuestionnaireEntity docTeamSurveyQuestionnaireEntity) {
        return this.save(docTeamSurveyQuestionnaireEntity);
    }
}
